home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / iobuf.h.z / iobuf.h
Text File  |  1992-04-03  |  2KB  |  50 lines

  1. /*    Copyright (c) 1984 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. /*#ident    "@(#)kern-port:sys/iobuf.h    10.2"*/
  9. #ident    "$Revision: 3.4 $"
  10. /*
  11.  * Each IDFC controller has an iobuf, which contains private state data
  12.  * and 2 list heads: the b_forw/b_back list, which is doubly linked
  13.  * and has all the buffers currently associated with that major
  14.  * device; and the d_actf/d_actl list, which is private to the
  15.  * controller but in fact is always used for the head and tail
  16.  * of the I/O queue for the device.
  17.  * Various routines in bio.c look at b_forw/b_back
  18.  * (notice they are the same as in the buf structure)
  19.  * but the rest is private to each device controller.
  20.  */
  21. typedef struct iobuf
  22. {
  23.     sema_t    b_lock;            /* lock for buffer usage */
  24.     int    b_flags;        /* see buf.h */
  25.     struct    buf *b_forw;        /* first buffer for this dev */
  26.     struct    buf *b_back;        /* last buffer for this dev */
  27.     struct    buf *b_actf;        /* head of I/O queue (b_forw)*/
  28.     struct     buf *b_actl;        /* tail of I/O queue (b_back)*/
  29.     dev_t    b_dev;            /* major+minor device name */
  30.     char    b_active;        /* busy flag */
  31.     char    b_errcnt;        /* error count (for recovery) */
  32.     int    jrqsleep;        /* process sleep counter on jrq full */
  33.     struct eblock    *io_erec;    /* error record */
  34.     int    io_nreg;        /* number of registers to log on errors */
  35.     paddr_t    io_addr;        /* local bus address */
  36.     physadr    io_mba;            /* mba address */
  37.     struct    iostat    *io_stp;    /* unit I/O statistics */
  38.     time_t    io_start;
  39.     int    sgreq;            /* SYSGEN required flag */
  40.     int    qcnt;            /* outstanding job request counter */
  41.     int    io_s1;            /* space for drivers to leave things */
  42.     int    io_s2;            /* space for drivers to leave things */
  43. } iobuf_t;
  44.  
  45. #define tabinit(dv,stat) {0,0,0,0,0,makedev(dv,0),0,00,0,0,0,0,0,stat,0,0,0,0,0}
  46. #define NDEVREG    (sizeof(struct device)/sizeof(int))
  47.  
  48. #define    B_ONCE    01    /* flag for once only driver operations */
  49. #define    B_TIME    04    /* for timeout use */
  50.